using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class charttmpMap : EntityTypeConfiguration<charttmp>
    {
        public charttmpMap()
        {
            // Primary Key
            this.HasKey(t => t.ChartId);

            // Properties
            // Table & Column Mappings
            this.ToTable("charttmp");
            this.Property(t => t.ChartId).HasColumnName("ChartId");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.HeadID).HasColumnName("HeadID");
            this.Property(t => t.tooth_nb).HasColumnName("tooth_nb");
            this.Property(t => t.type).HasColumnName("type");
            this.Property(t => t.init).HasColumnName("init");
            this.Property(t => t.ext_s).HasColumnName("ext_s");
            this.Property(t => t.bcrn_s).HasColumnName("bcrn_s");
            this.Property(t => t.bcrn2_s).HasColumnName("bcrn2_s");
            this.Property(t => t.linkl_s).HasColumnName("linkl_s");
            this.Property(t => t.linkr_s).HasColumnName("linkr_s");
            this.Property(t => t.crn_s).HasColumnName("crn_s");
            this.Property(t => t.bld1_s).HasColumnName("bld1_s");
            this.Property(t => t.bld2_s).HasColumnName("bld2_s");
            this.Property(t => t.bld3_s).HasColumnName("bld3_s");
            this.Property(t => t.phm1_s).HasColumnName("phm1_s");
            this.Property(t => t.phm2_s).HasColumnName("phm2_s");
            this.Property(t => t.phm3_s).HasColumnName("phm3_s");
            this.Property(t => t.imp_s).HasColumnName("imp_s");
            this.Property(t => t.abs1_s).HasColumnName("abs1_s");
            this.Property(t => t.abs2_s).HasColumnName("abs2_s");
            this.Property(t => t.abs3_s).HasColumnName("abs3_s");
            this.Property(t => t.tooth_type).HasColumnName("tooth_type");
            this.Property(t => t.endo1_s).HasColumnName("endo1_s");
            this.Property(t => t.endo1_c).HasColumnName("endo1_c");
            this.Property(t => t.endo2_s).HasColumnName("endo2_s");
            this.Property(t => t.endo2_c).HasColumnName("endo2_c");
            this.Property(t => t.endo3_s).HasColumnName("endo3_s");
            this.Property(t => t.endo3_c).HasColumnName("endo3_c");
            this.Property(t => t.lay_s).HasColumnName("lay_s");
            this.Property(t => t.f1_s).HasColumnName("f1_s");
            this.Property(t => t.f2_s).HasColumnName("f2_s");
            this.Property(t => t.f3_s).HasColumnName("f3_s");
            this.Property(t => t.f4_s).HasColumnName("f4_s");
            this.Property(t => t.f5_s).HasColumnName("f5_s");
            this.Property(t => t.note).HasColumnName("note");
            this.Property(t => t.bdg_s).HasColumnName("bdg_s");
            this.Property(t => t.bdg_last).HasColumnName("bdg_last");
            this.Property(t => t.bdg_1).HasColumnName("bdg_1");
            this.Property(t => t.spaceb_s).HasColumnName("spaceb_s");
            this.Property(t => t.spaceb_c).HasColumnName("spaceb_c");
            this.Property(t => t.spaceb_str).HasColumnName("spaceb_str");
            this.Property(t => t.spaceb_end).HasColumnName("spaceb_end");
            this.Property(t => t.spaceb_m).HasColumnName("spaceb_m");
            this.Property(t => t.spaceu_str).HasColumnName("spaceu_str");
            this.Property(t => t.spaceu_end).HasColumnName("spaceu_end");
            this.Property(t => t.spaceu_c).HasColumnName("spaceu_c");
            this.Property(t => t.spaceu_s).HasColumnName("spaceu_s");
            this.Property(t => t.spaceu_m).HasColumnName("spaceu_m");
            this.Property(t => t.treated).HasColumnName("treated");
            this.Property(t => t.wg).HasColumnName("wg");
            this.Property(t => t.loc).HasColumnName("loc");
            this.Property(t => t.user_s).HasColumnName("user_s");
            this.Property(t => t.fis_s).HasColumnName("fis_s");
            this.Property(t => t.fis_c).HasColumnName("fis_c");
            this.Property(t => t.prr_s).HasColumnName("prr_s");
            this.Property(t => t.prr_c).HasColumnName("prr_c");
            this.Property(t => t.endoc0_s).HasColumnName("endoc0_s");
            this.Property(t => t.endoc1_s).HasColumnName("endoc1_s");
            this.Property(t => t.endoc1_c).HasColumnName("endoc1_c");
            this.Property(t => t.endoc2_s).HasColumnName("endoc2_s");
            this.Property(t => t.endoc2_c).HasColumnName("endoc2_c");
            this.Property(t => t.endoc3_s).HasColumnName("endoc3_s");
            this.Property(t => t.endoc3_c).HasColumnName("endoc3_c");
            this.Property(t => t.rotate_s).HasColumnName("rotate_s");
            this.Property(t => t.imature_s).HasColumnName("imature_s");
            this.Property(t => t.imature_c).HasColumnName("imature_c");
            this.Property(t => t.miss_s).HasColumnName("miss_s");
            this.Property(t => t.build_s).HasColumnName("build_s");

            // Relationships
            this.HasRequired(t => t.ChartHead)
                .WithMany(t => t.charttmps)
                .HasForeignKey(d => d.HeadID);

        }
    }
}
